package com.ruoyi.system.service;

import com.alibaba.fastjson.JSON;
import com.ruoyi.RuoYiApplication;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.json.JSONObject;
import com.ruoyi.system.controller.AlpContractDetailController;
import com.ruoyi.system.controller.AlpMonthlyController;
import com.ruoyi.system.domain.AlpContractDetail;
import com.ruoyi.system.domain.AlpMonthly;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;


@RunWith(SpringRunner.class)
@SpringBootTest(classes = RuoYiApplication.class)
public class IAlpYingshouServiceTest {

    @Autowired IAlpYingshouService alpYingshouService;
    @Autowired AlpMonthlyController monthlyController;

    @Autowired AlpContractDetailController contractDetailController;
    @Test
    public void testYingshou() {
        Map<String, List<BigDecimal>> res = alpYingshouService.calcWeekSum();

        System.out.println(JSON.toJSONString(res));
    }

    @Test
    public void testmonth() {
        AlpMonthly alpMonthly = new AlpMonthly();
        TableDataInfo tableDataInfo = monthlyController.list(alpMonthly);

        System.out.println(JSON.toJSONString(tableDataInfo));
    }

    @Test
    public void testEachWeek() {
        for (int i = 1; i<=53; i++) {
            System.out.println(alpYingshouService.calcEachWeekSumBudget(i, 2L,2020));
        }
    }


}